package FirstExam10tasks;

import java.util.Scanner;

public class Task1 {

	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		System.out.println("Enter a number to check if it's cube!");
		
		int number = sc.nextInt();
		int help = 1;
		int check = 1;
		boolean flag = false;
		
		while(help <= number)
		{
			if(check*check*check == number)
			{
				flag = true;
				break;
			}
			else
			{
				help = check*check*check;
				check++;
			}
		}
		
		if(flag == true)
		{
			System.out.println(number + " is a cube of " + check);
		}
		else
		{
			System.out.println(number + " is not a cube");
		}
	}

}
